package cn.study.luckyadapter.controller.admin;

import cn.study.common.annotation.ResponseResult;
import cn.study.luckyclient.api.IActivityConfigService;
import cn.study.luckyclient.dto.ActivityAddCmd;
import cn.study.luckyclient.dto.ActivityConfigAddCmd;
import cn.study.luckyclient.dto.ActivityConfigUpdateCmd;
import cn.study.luckyclient.dto.ActivityUpdateCmd;
import cn.study.luckyclient.dto.data.ActivityConfigVo;
import cn.study.luckyclient.dto.data.ActivityRuleVo;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@ResponseResult
@AllArgsConstructor
@RequestMapping("/admin/v1/activityConfig")
public class AdminActivityConfigController {
    private final IActivityConfigService activityConfigService;
    @PostMapping("/add")
    public ActivityConfigVo add(@RequestBody ActivityConfigAddCmd activityAddCmd){
        return activityConfigService.add(activityAddCmd);
    }
    @PostMapping("/update")
    public ActivityConfigVo update(@RequestBody ActivityConfigUpdateCmd cmd){
        return activityConfigService.update(cmd);
    }
    @GetMapping("/one")
    public ActivityConfigVo one(@RequestParam("id") Long id){
        return activityConfigService.one(id);
    }
}
